package com.lin.fengxiu.api.v1;

import com.lin.fengxiu.manager.rocketmq.ProducerSchedule;
import org.apache.rocketmq.client.exception.MQBrokerException;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.remoting.exception.RemotingException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName TestController
 * @Description TODO
 * @Author wushaopei
 * @Date 2021/4/16 6:50
 * @Version 1.0
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private ProducerSchedule producerSchedule;

    @GetMapping("/push")
    public void pushMessageToMQ() throws InterruptedException, RemotingException, MQClientException, MQBrokerException {
        // topic：消息主题、messageText:消息内容
        producerSchedule.send("TopicTest", "test");
    }


}
